Each digit in the display is controlled by 8 data bits. Since we have 4 digits we would seem to need 4 * 8 or 32 pins to control the display. This is more than our PICmicro has, so we need to use a trick. The trick is to wire all the displays together across the same 8 pins of PORTB. When I put a pattern on PORTB all of the 7 segment displays will see it. However, they will not actually display anything unless they are enabled by a bit on PORTA - as shown in the circuit diagram on the previous screen.
If I want to display a value on a particular 7 segment unit I have to present the pattern which specifies which segments are to be lit on PORTB and then set the bit for that unit. It then lights up. This has the limitation that at any given instant I can only control one unit at a time. However, if my program rapidly cycles through the LEDs the person viewing the number will not notice the flicker and a number will be displayed. Of course, if my program stops for any reason I will lose my number display.
There is another useful side effect of this approach, in that the LEDs are not all lit at once. This dramatically reduces the power consumption of the device, while preserving the display. You can see this trick used in many battery powered systems - the best way to spot it is to eat some crisps (or potato chips if you are in the USA) while watching the digits, they will appear to bounce around around as your eyes see them at slightly different positions for an instant!